package com.shanghaionstar.nav;

import android.os.Bundle;

import com.onstar.cn.framework.annotation.ContentView;
import com.onstar.cn.framework.mvp.base.core.BasePresenter;
import com.onstar.cn.map.common.LocationType;
import com.onstar.cn.map.common.PoiItemInfo;
import com.shanghaionstar.R;
import com.shanghaionstar.nav.model.MapChoosePoiType;
import com.shanghaionstar.nav.service.AbstractMapActivity;
import com.shanghaionstar.utils.MapHandler;

/**
 * Created by 6335yz on 2016/7/7.
 */
@ContentView(R.layout.fragment_container)
public class NavChooseInMapActivity extends AbstractMapActivity {
    private NavChoosePointInMapFragment navChoosePointInMapFragment;
    private NavSetAddressFragment navSetAddressFragment;

    @Override
    public void initMapHandler(MapHandler mapHandler) {
        this.mapHandler = mapHandler;
    }

    @Override
    public BasePresenter getPresenter() {
        return null;
    }

    @Override
    public void showPoiToMap(PoiItemInfo poiItemInfo, LocationType locationType) {

    }

    /**
     *
     *
     * @param savedInstanceState
     */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        MapChoosePoiType mapChoosePoiType = (MapChoosePoiType)getIntent().getSerializableExtra("mapChoosePoiType");
        NavSetAddressFragment navSetAddressFragment = NavSetAddressFragment.newInstance(mapChoosePoiType);
        NavChoosePointInMapFragment navChoosePointInMapFragment = NavChoosePointInMapFragment.newInstance(mapChoosePoiType);
        addFragment(getSupportFragmentManager(), navChoosePointInMapFragment, true);
        addFragment(getSupportFragmentManager(), navSetAddressFragment, false);
        showFragment(getSupportFragmentManager(), navSetAddressFragment.getClass(), null);
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        finish();
    }
}
